import { LoginParams, Method, PageParams } from "../types/request.d";
import { UserResponse } from "../types/response.d";
import request from "../utils/request";
export function login(data: LoginParams) {
  return request({
    url: "/login?username=mrbird&password=1234qwer&verifyCode=1122",
    method: Method.POST,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    data,
  });
}

export function deptSelectTree() {
  return request({
    url: "/dept/select/tree",
    method: Method.GET,
    // data,
  });
}

// 返回值什么类型 : Promise
export function getUserList(params: PageParams):Promise<UserResponse> {
  return request.request({
    url: `/user/list?pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
    method: Method.GET,
    // data,
  });
}
